package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.AtmCassetteRepairRecordMapper;
import com.zone.service.domain.AtmCassetteRepairRecord;
import com.zone.service.service.IAtmCassetteRepairRecordService;

/**
 * ATM钞箱维修记录Service业务层处理
 * 
 * @author liuyang
 * @date 2025-10-30
 */
@Service
public class AtmCassetteRepairRecordServiceImpl implements IAtmCassetteRepairRecordService 
{
    @Autowired
    private AtmCassetteRepairRecordMapper atmCassetteRepairRecordMapper;

    /**
     * 查询ATM钞箱维修记录
     * 
     * @param id ATM钞箱维修记录主键
     * @return ATM钞箱维修记录
     */
    @Override
    public AtmCassetteRepairRecord selectAtmCassetteRepairRecordById(Long id)
    {
        return atmCassetteRepairRecordMapper.selectAtmCassetteRepairRecordById(id);
    }

    /**
     * 查询ATM钞箱维修记录列表
     * 
     * @param atmCassetteRepairRecord ATM钞箱维修记录
     * @return ATM钞箱维修记录
     */
    @Override
    public List<AtmCassetteRepairRecord> selectAtmCassetteRepairRecordList(AtmCassetteRepairRecord atmCassetteRepairRecord)
    {
        return atmCassetteRepairRecordMapper.selectAtmCassetteRepairRecordList(atmCassetteRepairRecord);
    }

    /**
     * 新增ATM钞箱维修记录
     * 
     * @param atmCassetteRepairRecord ATM钞箱维修记录
     * @return 结果
     */
    @Override
    public int insertAtmCassetteRepairRecord(AtmCassetteRepairRecord atmCassetteRepairRecord)
    {
        atmCassetteRepairRecord.setCreateTime(DateUtils.getNowDate());
        return atmCassetteRepairRecordMapper.insertAtmCassetteRepairRecord(atmCassetteRepairRecord);
    }

    /**
     * 修改ATM钞箱维修记录
     * 
     * @param atmCassetteRepairRecord ATM钞箱维修记录
     * @return 结果
     */
    @Override
    public int updateAtmCassetteRepairRecord(AtmCassetteRepairRecord atmCassetteRepairRecord)
    {
        atmCassetteRepairRecord.setUpdateTime(DateUtils.getNowDate());
        return atmCassetteRepairRecordMapper.updateAtmCassetteRepairRecord(atmCassetteRepairRecord);
    }

    /**
     * 批量删除ATM钞箱维修记录
     * 
     * @param ids 需要删除的ATM钞箱维修记录主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteRepairRecordByIds(Long[] ids)
    {
        return atmCassetteRepairRecordMapper.deleteAtmCassetteRepairRecordByIds(ids);
    }

    /**
     * 删除ATM钞箱维修记录信息
     * 
     * @param id ATM钞箱维修记录主键
     * @return 结果
     */
    @Override
    public int deleteAtmCassetteRepairRecordById(Long id)
    {
        return atmCassetteRepairRecordMapper.deleteAtmCassetteRepairRecordById(id);
    }
    
    /**
     * 批量新增ATM钞箱维修记录
     * 
     * @param atmCassetteRepairRecordList ATM钞箱维修记录列表
     * @return 结果
     */
    @Override
    public int insertAtmCassetteRepairRecordList(List<AtmCassetteRepairRecord> atmCassetteRepairRecordList)
    {
        int rows = 0;
        for (AtmCassetteRepairRecord atmCassetteRepairRecord : atmCassetteRepairRecordList) {
            atmCassetteRepairRecord.setCreateTime(DateUtils.getNowDate());
            rows += atmCassetteRepairRecordMapper.insertAtmCassetteRepairRecord(atmCassetteRepairRecord);
        }
        return rows;
    }

    /**
     * 批量插入ATM钞箱维修记录数据
     *
     * @param atmCassetteRepairRecordList
     * @return 结果
     */
    @Override
    public int batchInsertAtmCassetteRepairRecord(List<AtmCassetteRepairRecord> atmCassetteRepairRecordList) {
        return atmCassetteRepairRecordMapper.batchInsertAtmCassetteRepairRecord(atmCassetteRepairRecordList);
    }
}